import request from '@/utils/request'


/**
 * 用户注册账号
 * @param {*} obj 
 */
export const registerService = (obj) => {
  return  request.post('/user/register', obj)
}

/**
 * 获取邮箱验证码
 * @param {*} email 
 */
export const getCodeService = (email) => {
  return request.post(`/user/code/${email}`)
}

/**
 * 用户登录
 * @param {*} obj 
 */
export const loginService = (obj) => {
  return request.post('/user/login', obj)
}

/**
 * 忘记密码校验
 * @param {*} obj 
 * @returns 
 */
export const forgetTestService = (obj) => {
  return request.post('/user/forget/password', obj)
}

/**
 * 忘记密码获取验证码
 * @param {*} email
 * @returns 
 */
export const getCodeForgetService = (email) => {
  return request.post(`/user/replace/code/${email}`)
}

/**
 * 重置密码
 * @param {*} obj 
 * @param {*} userId 
 * @returns 
 */
export const replacePasswordService = (obj,userId) => {
  return request.post('/user/replace/password', obj, {
    headers: {
      'Mivn-UserId' : userId
    }
  })
}
